const Router = require('@koa/router')()

const { read_dir, fileList } = require('../utils/read_dir')

read_dir(__dirname,'../module')

fileList.forEach(item => {
    const file_content = require(item)
    file_content.forEach(item => {
        Router[item.request](item.path, item.method)
    })
})

module.exports = Router